#ifndef XKIT_COLLECTIONS_QUEUE_H
#define XKIT_COLLECTIONS_QUEUE_H

#include "../ref.h"
#include <stdbool.h>

typedef struct QueueHeader {
    Reference *ref;
    size_t length;
    size_t headIndex;
    size_t tailIndex;
    losu_object_t value;
} QueueHeader;

QueueHeader *QueueInit(losu_vm_t vm, size_t size);
void QueueFree(losu_vm_t vm, QueueHeader *h);
void QueueEnqueue(losu_vm_t vm, QueueHeader *h, losu_object_t o);
void QueueDequeue(losu_vm_t vm, QueueHeader *h, losu_object_t o);
void QueuePeek(losu_vm_t vm, QueueHeader *h, losu_object_t o);
bool QueueEmpty(losu_vm_t vm, QueueHeader *h);
bool QueueFull(losu_vm_t vm, QueueHeader *h);
size_t QueueSize(losu_vm_t vm, QueueHeader *h);

#endif
